<?php
class Form_News extends Zend_Form
{
    public function init()
    {
        $this->setMethod('post');
        $this->setAttrib('class','frmLarge');
    	
        // create new element
        $id = $this->createElement('hidden', 'id');
        $id->setDecorators(array('ViewHelper'));
        $this->addElement($id);

        $title_vi = $this->createElement('text', 'title_vi');
        $title_vi->setLabel('Title VI: ');
        $title_vi->setRequired(TRUE);
        $title_vi->setAttrib('size',512);
        $title_vi->addFilter('StripTags'); 
        $this->addElement($title_vi);
        
        $title_en = $this->createElement('text', 'title_en');
        $title_en->setLabel('Title EN: ');
        $title_en->setRequired(TRUE);
        $title_en->setAttrib('size',512);
        $title_en->addFilter('StripTags'); 
        $this->addElement($title_en);
        
        $summary_vi = $this->createElement('text', 'summary_vi');
        $summary_vi->setLabel('Summary VI: ');
        $summary_vi->setRequired(TRUE);
        $summary_vi->addFilter('StripTags'); 
        $this->addElement($summary_vi);
        
        $summary_en = $this->createElement('text', 'summary_en');
        $summary_en->setLabel('Summary EN: ');
        $summary_en->setRequired(TRUE);
        $summary_en->addFilter('StripTags'); 
        $this->addElement($summary_en);
        
        $this->addElement('fck', 'content_vi', array(
                'label'      => 'Content VI',
                'required'   => true,
                'editorOptions' => new Zend_Config_Ini(APPLICATION_PATH . '/configs/fck.ini', 'moderator')
        ));
        
        $this->addElement('fck', 'content_en', array(
                'label'      => 'Content EN',
                'required'   => true,
                'editorOptions' => new Zend_Config_Ini(APPLICATION_PATH . '/configs/fck.ini', 'moderator')
        ));
        
        $this->clearDecorators();
        $this->addDecorator('FormElements')
            ->addDecorator('Description', array('class' => 'frmSmall'))            
            ->addDecorator('Form');
            
        $this->setElementDecorators(array(
            array('ViewHelper'),
            array('Errors'),
            array('Description'),
            array('Label', array('separator'=>' ')),
            array('HtmlTag', array('tag' => 'p')),
        ));
        
        $submit = $this->createElement('submit','submit');
        $submit->setDecorators(array(
            array('ViewHelper'),
            array('Description'),
            array('HtmlTag', array('tag' => 'p', 'class'=>'btn')),
        ));
        $this->addElement($submit);     
    }
}
?>
